package name.ekr.assetguide.test;


import name.ekr.assetguide.domain.Portfolio;
import org.fest.assertions.Delta;

import static org.fest.assertions.Assertions.assertThat;
import static org.fest.reflect.core.Reflection.field;

public class Assertions {
    public static void assertThatFieldIs(Portfolio portfolio, String field, double value) {
        assertThat(
                field(field).ofType(double.class).in(portfolio).get()
        ).isEqualTo(value, Delta.delta(0.00001));
    }
}
